using Caliburn.Micro;

using Action = System.Action;

namespace SamizdatSearch
{
  public class GenreSelecor : PropertyChangedBase
  {
    private readonly Action _changed;
    public string Name { get; private set; }
    private bool _isSelected;
    public bool IsSelected
    {
      get { return _isSelected; }
      set
      {
        if (_isSelected == value) return;
        _isSelected = value;
        _changed();
      }
    }

    public GenreSelecor(string name, Action changed, bool isSelected = false)
    {
      _changed = changed;
      _isSelected = isSelected;
      Name = name;
    }
  }
}